﻿using FaceRecognizer;
using PRJ1113.Camera;
using project1113.iniParser;
using project1113.Security;
using project1113.observer;
namespace project1113.Wrold
{
    public class WorldModel
    {
        public static WorldModel CurrentWorld { get; } = new WorldModel();
        public readonly object lockObject = new object();//bitmap锁
        public ConfigFileReader SettingTable = new ConfigFileReader(@"conf/SettingTable.ini",new Observe_err());
        public Robot.Robot Robot{ get;private set; } = new Robot.Robot();
        public TTS.TTS TTS { get; private set; } = new TTS.TTS();
        public Camera Camera { get; private set; } = new Camera();
        public SecurityGuarder Security { get;  set; } = new SecurityGuarder();
        
        public SpeechRecoginzer.SpeechRecoginzer SpeechRecoginzer { get; } = new SpeechRecoginzer.SpeechRecoginzer();

        public Face Face = new Face();
        private WorldModel() { }
        public void WorldUpdate()
        {
            Camera.Update();
           
            SpeechRecoginzer.Update();

            //foreach (var item in members)
            //{
            //    if (item is IDeviceUpdate device)
            //    {
            //        device.Update();
            //    }
            //}
        }
    }
}